home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / qlib205.zip / QLIB.ZIP / TXT / FUNC.TXT < prev    next >
Text File  |  1997-07-09  |  3KB  |  117 lines

  1. Functions i've made:
  2. --------------------
  3.   All functions are built automatically into EXE unless
  4. other wise stated.
  5.  
  6.  
  7. -----------
  8. getint,vec:byte
  9.   - get PMODE int vector
  10. setint,vec:byte,sel:word,off:dword
  11.   - set it
  12. malloc,siz:dword
  13.   - alloc RAM (just like in C)  (NULL if none avail)
  14. cmalloc,siz1:dword,siz2:dword  ;total size= siz1*siz2
  15.   - alloc RAM (just like in C)  (NULL if none avail)
  16.   - also clears alloc RAM to 0
  17. qfree
  18.   - query largest free RAM avail.  (eax=largest free)
  19. coreleft
  20.   - query total free RAM avail.    (eax=free ram)
  21. free,blk:dword
  22.   - free a block alloc from malloc or calloc
  23. getenv,nam:dword
  24.   - get an enviroment string ptr  (NULL if not found)
  25. exit,errorcode:byte
  26.   - exits to DOS (func will do cleanup)
  27.   - DO NOT CALL int 21h/ah=4c00 directly
  28.  
  29. DATA avail from QLIB
  30. --------------------
  31.   selcode dw - code selector
  32.   seldata dw - data selector
  33.   selzero dw - zero selector
  34.   _environ dd - ptr to enviroment table
  35.   _psp dd - ptr to PSP
  36.   _pmmode db - current PM mode = (SRV_RAW, SRV_XMS, SRV_VCPI or SRV_DPMI)
  37.   _dta dd - ptr to DTA area (default = _psp+80h)
  38.   plus other unimportant stuff...
  39.  
  40. string
  41. ------
  42.  
  43. str2num,str:dword
  44.   - convert a string to a number  (always returned in eax)
  45.   - string may start with + or - and leading spaces etc.
  46.  
  47. num2str,n:dword,str:dword,radix:byte
  48.  - convert # to string (unsigned)
  49. num2strc,n:dword,str:dword,radix:byte
  50.  - convert # to string (unsigned and capitals)
  51. num2strs,n:dword,str:dword,radix:byte
  52.  - convert # to string (signed)
  53. num2strsc,n:dword,str:dword,radix:byte
  54.  - convert # to string (signed and capitals)
  55.  
  56. print,str:dword
  57.   - simply print string
  58. printxy,x:word,y:word,str:dword
  59.   - print at screen pos x,y
  60. gotoxy,x:word,y:word
  61.   - change cursor pos x,y
  62. wherex
  63.   - get current X cursor pos
  64. wherey
  65.   - get current Y cursor pos
  66.  
  67. clrscr
  68.   - clears screen
  69.  
  70. setcursor,scan:word
  71.   - sets cursor start/stop scan lines  (a value of 512 removes cursor)
  72.  
  73. strcpy , strcat, strlen ,strcmp
  74. strccpy, stricmp, strcspn, etc.  (all string functions as in C)
  75. printf, sprintf, sscanf, scanf - all as in C
  76.  
  77. file I/O
  78. --------
  79. open,file:dword,access:byte    ;0=read 1=read/write  (directly given to DOS)
  80.   - open a file
  81. close,h:word
  82. read,h:word,buf:dword,len:dword
  83. write,h:word,buf:dword,len:dword
  84. lseek,h:word,pos:dword,typ:byte   ;0=from start  1=relative  2=from end
  85.  
  86. keyboard services
  87. -----------------
  88. getch
  89.   - reads one key.  AH=scan code  AL=char
  90.   NOTE: if al<32 or al>128 then it's a special code (see key.txt)
  91. getchw
  92.   - same but does not wait for a key (returns 0 if there is no key)
  93. kbhit
  94.   - detects if key is avail
  95.  
  96. text.asm   (not linked in automatically - you must include it)
  97. --------
  98. NOTE: to add this just include it.  It's in the INC directory.
  99. backfill,x:word,xl:word,y:word,yl:word
  100.   - fills background with char
  101. box,x:word,xl:word,y:word,yl:word
  102.   - fills a solid BOX
  103. box1,x:word,xl:word,y:word,yl:word
  104.   - draws a single-line box
  105. box2,x:word,xl:word,y:word,yl:word
  106.   - draws a double-line box
  107. bar,x:word,y:word,xl:word,col:byte
  108.   - draws a bar underneath text
  109.  
  110.  
  111. Please also see
  112.  video.txt
  113.  pack.txt
  114.  dma.txt
  115.  callback.txt
  116.  
  117.